﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MODEL;
using DAL;

namespace BLL
{
    public class StudentBLL
    {
        StudentDAL dal = new StudentDAL();

        public StudentModel QueryByCondition(string name, string pwd)
        {
            return dal.QueryByCondition(name, pwd);
        }

        public StudentModel QueryByCondition(string id)
        {
            return dal.QueryByCondition(id);
        }

        public bool Update(StudentModel model)
        {
            if (dal.Update(model) > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public bool AddNew(StudentModel model)
        {
            if (dal.AddNew(model) > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public List<StudentModel> QueryByPageIndex(int pageIndex)
        {
            return dal.QueryByPageIndex(pageIndex);
        }

        public List<StudentModel> ListAll()
        {
            return dal.ListAll();
        }

        public bool SoftDel(string id)
        {
            int i = dal.SoftDel(id);
            if (i == 1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public int UpdateSSupport_Output(StudentModel model)
        {
            int i = (int)dal.UpdateSSupport_Output(model);
            return i;
        }

        public int UpdateSDisSupport_Output(StudentModel model)
        {
            int i = (int)dal.UpdateSDisSupport_Output(model);
            return i;
        }

    }
}
